/**
 * Created by wanghuan on 2016/7/22.
 */

<template>
  <div class="spinner" v-show="show">
    <div class="rect1"></div>
    <div class="rect2"></div>
    <div class="rect3"></div>
    <div class="rect4"></div>
    <div class="rect5"></div>
  </div>
</template>

<script>
  export  default{
    computed:{
      show(){
        return this.$store.getters.globalLoading;
      }
    }
  }
</script>

<style rel="stylesheet/scss" type="text/css" lang="scss" scoped>
  .spinner {
    position: fixed;
    left: 50%;
    top:50%;
    width: 50px;
    height: 60px;
    margin-left: -25px;
    margin-top: -30px;
    text-align: center;
    font-size: 10px;
    z-index: 998;
  }
/*  .spinner:before{
    content: "";
    position: fixed;
    display: block;
    width: 100%;
    top: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0,0,0,.9);
  }*/
  .spinner > div {
    background-color: #0c9afd;
    height: 100%;
    width: 6px;
    display: inline-block;
    -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
    animation: stretchdelay 1.2s infinite ease-in-out;
  }

  .spinner .rect2 {
    -webkit-animation-delay: -1.1s;
    animation-delay: -1.1s;
  }

  .spinner .rect3 {
    -webkit-animation-delay: -1.0s;
    animation-delay: -1.0s;
  }

  .spinner .rect4 {
    -webkit-animation-delay: -0.9s;
    animation-delay: -0.9s;
  }

  .spinner .rect5 {
    -webkit-animation-delay: -0.8s;
    animation-delay: -0.8s;
  }

  @-webkit-keyframes stretchdelay {
    0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
    20% { -webkit-transform: scaleY(1.0) }
  }

  @keyframes stretchdelay {
    0%, 40%, 100% {
      transform: scaleY(0.4);
      -webkit-transform: scaleY(0.4);
    }  20% {
         transform: scaleY(1.0);
         -webkit-transform: scaleY(1.0);
       }
  }
</style>
